package keter.sec.springsec.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by gkatzioura on 9/2/16.
 */
@Controller
public class HomeController extends BaseController{

	@GetMapping("/")
	public String index(Map<String, Object> model) {
		return "ajax/login";
	}

	@GetMapping("/home")
	public String home(Map<String, Object> model) {
		model.put("user", getCurrentUser());
		return "home";
	}

	@GetMapping("/login")
	public String login(Map<String, Object> model) {
		System.out.println("hahaha");
		return "login/login";
	}

	@GetMapping("/user/haha")
	@ResponseBody
	public String userHaha() {
		return "haha";
	}

	@GetMapping("/admin/haha")
	@ResponseBody
	public String adminHaha() {
		return "admin";
	}
}
